import ajax from '../utils/axios';

export async function getVipList(params){
  const res=await ajax.get('/vip',{params});
  return res.data.data;
}

export async function getVipDetail(id){
  const res=await ajax.get(`/vip/${id}`);
  return res.data.data;
}

export async function createVip(params){
    // interface params {
    //   id_card: string;
    //   name: string;
    //   phone_number: string;
    // }
  const res=await ajax.post(`/vip`, params);
  return res.data.data;
}

export async function editVip(id,params){
  // interface params {
//   id_card:      string;
//   name:         string;
//   phone_number: string;
// }
  const res=await ajax.put(`/vip/${id}`, params);
  return res.data.data;
}

export async function delVip(id){
  const res=await ajax.delete(`/vip/${id}`);
  return res.data.data;
}



export async function batchDelVip(id_list){
  const res=await ajax.delete(`/vip/batch_delete`, id_list);
  return res.data.data;
}